package com.cmzj21.springcloud.service;

import com.cmzj21.springcloud.service.impl.PaymentFallbackService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author cmzj21
 */
@Component
@FeignClient(value = "cloud-payment-hystrix-service", fallback = PaymentFallbackService.class)
public interface PaymentHystrixService {
    /**
     * ok方法
     * @param id id
     * @return 成功
     */
    @GetMapping("/payment/ok/{id}")
    String ok(@PathVariable("id") Integer id);

    /**
     * failed
     * @param id id
     * @return 失败
     */
    @GetMapping("/payment/failed/{id}")
    String failed(@PathVariable("id") Integer id);
}
